/*
 * Copyright (c) 2023 Cshoo Org. All Rights Reserved.
 */

package org.cshoo.tattoo.embed.api;

import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.cshoo.tattoo.embed.api.dto.AuthorityResp;
import org.cshoo.tattoo.embed.app.AuthoritySdkAppService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 杨翼
 * @since 1.0
 */
@RestController
@RequestMapping(value = "/authority")
@Slf4j
public class AuthoritySdkController {

    @Resource
    private AuthoritySdkAppService authoritySdkAppService;

    @ApiOperation("加载权限列表，用于微服务内部调用")
    @RequestMapping(value = "/loadAuthorities", method = RequestMethod.GET)
    public List<AuthorityResp> loadAuthorities() {
        return authoritySdkAppService.loadAuthorities();
    }

}
